using Assets.Scripts.GDK;
using UnityEngine.UI;

namespace Brick
{
	public class DailyItem : gdk_base_layer
	{
		public Text textIndex;

		public Image image;

		public Image zsImage;

		public Image qdImage;

		private int splitIndex;

		private DayModel _dayInfo;

		public void OnData(DayModel dayInfo, bool isSign)
		{
			_dayInfo = dayInfo;
			splitIndex = _dayInfo.Day;
			if ((bool)textIndex)
			{
				textIndex.text = "x" + _dayInfo.rewardCount.ToString();
			}
			if (isSign)
			{
				qdImage.gameObject.SetActive(value: true);
			}
			else
			{
				qdImage.gameObject.SetActive(value: false);
			}
			if (dayInfo.rewardType == 2)
			{
				image.sprite = gdk_game_manager.loadSprite("UI/Common/common_zs");
			}
			else if (dayInfo.rewardType == 3)
			{
				image.sprite = gdk_game_manager.loadSprite("UI/Game/dj_2");
			}
			else if (dayInfo.rewardType == 4)
			{
				image.sprite = gdk_game_manager.loadSprite("UI/Game/dj_1");
			}
			else if (dayInfo.rewardType == 5)
			{
				image.sprite = gdk_game_manager.loadSprite("UI/Game/dj_5");
			}
			else if (dayInfo.rewardType == 6)
			{
				image.sprite = gdk_game_manager.loadSprite("UI/Game/dj_3");
			}
			else if (dayInfo.rewardType == 7)
			{
				image.sprite = gdk_game_manager.loadSprite("UI/Game/dj_4");
			}
			image.SetNativeSize();
		}

		public void OnSign()
		{
			qdImage.gameObject.SetActive(value: true);
		}
	}
}

